<!-- head -->
{include file='public/head' /}
<!-- head -->

<!-- left -->
{include file='public/left' /}
<!-- left -->

<div class="content-wrapper">
    <section class="content-header">
        <h1>
            店铺列表
            <small>待审核</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 店铺管理</a></li>
            <li class="active">审核店铺</li>
        </ol>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-sm-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">共计{$storeList->total()}条记录</h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <form id='iform' action="{:url('Store/AuditStore')}" method="get">
                                    <div class="input-group">
                                        <input type="text" name="store_name" value="{$store_name}" class="form-control" style="width: 25%;" placeholder="请输入店铺名...">
                                        <input type="text" name="phone" value="{$phone}" class="form-control" style="width: 25%;" placeholder="请输入负责人手机号...">
                                        <select class="form-control select2" style="width: 25%;" name="auditstore">
                                            <option selected="selected" value="-1">请选择状态</option>
                                            <option value="0">待审核</option>
                                            <option value="2">审核不通过</option>
                                        </select>
                                        <select class="form-control select2" style="width: 25%;" name="adminid">
                                            <option selected="selected" value="0">全部</option>
                                            {volist name='adminlist' id='adminlist'}
                                                {if condition="$adminlist['id'] eq $admin"}
                                                    <option value="{$adminlist.id}" selected>{$adminlist.admin_note}</option>
                                                    {else/}
                                                    <option value="{$adminlist.id}">{$adminlist.admin_note}</option>
                                                {/if}
                                            {/volist}
                                        </select>
                                        <span class="input-group-btn">
                                            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                                            </button>
                                        </span>
                                    </div>
                                </form>
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>店名</th>
                                        <th>手机</th>
                                        <th>法人</th>
                                        <th>状态</th>
                                        <th>地址</th>
                                        <th>地区</th>
                                        <th>注册时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name='storeList' id='admin'}
                                    <tr>
                                        <td>{$admin.id}</td>
                                        <td>{$admin.store_name}</td>
                                        <td><b>{$admin.keeper_phone}</b></td>
                                        <td>{$admin.store_keeper}</td>
                                        <td>
                                            {if condition="$admin.auditstore eq 0"}<span class="label label-success">待审核</span>
                                            {elseif condition="$admin.auditstore eq 2"/}<span class="label label-danger">审核不通过</span>
                                            {/if}
                                        </td>
                                        <td>{$admin.store_address}</td>
                                        <td>{$admin.prov_city_area.name}</td>
                                        <td>{$admin.add_time|date='Y-m-d H:i',###}</td>
                                        <td style="width: 100px; text-align:right;">
                                            <button type="button" class="btn btn-sm bg-olive" data-url="{:url('Store/AuditStoreDetails',['id'=>$admin.id],'')}" onclick="ShowMessage(this)">查看信息 </button>&nbsp;
                                            <!--                                            <button type="button" class="btn btn-sm btn-info" data-url="{:url('admin/admin/edit',['id'=>$admin.id],'')}" onclick="edit(this)">修改</button>&nbsp;-->
                                            <!--<button type="button" class="btn btn-sm btn-danger" onclick="del({$admin.id})">删除</button>-->
                                        </td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="box-footer clearfix" style="text-align: center">
                        {$storeList->render()}
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script type="text/javascript">

    var dataId = 0;
    function edit(obj) {
        var url = $(obj).data('url');
        window.location.href = url;
    }
    function ShowMessage(obj) {
        var url = $(obj).data('url');
        window.location.href = url;
    }

    function del(id) {
        dataId = id;
        showConfirm('删除', '确认删除？', delManager);
    }

    function delManager() {
        $.ajax({
            url: "{:url('admin/Store/DelStore','','')}",
            type: 'GET',
            data: {
                'id': dataId,
            },
            dataType: 'JSON',
            success: function (data) {
                showAlert('提示', data.msg, null);
                if (data.code == 1) {

                }
            }
        });
    }

</script>

<!-- foot -->
{include file='public/foot' /}
<!-- foot -->